package ahut2020.day16final;

public class Fibonacci {
    static int f(int n) {
        if (n <= 1) return n;
        return f(n - 1) + f(n - 2);
    }

    public static void main(String[] args) {
        System.out.println("T(100)=" + 0.104 * Math.pow(1.618, 70) / 3600 / 24 / 365);
        for (int i = 0; i < 50; i++) {
            long start = System.currentTimeMillis();
            f(i);//T(n)=c*(1.618)^n
            long end = System.currentTimeMillis();
            System.out.println(String.format("T(%d)=%d", i, end - start));
        }
    }
}
